Copy Folder function, why doesn't it work right?(Code incl)

Why doesn't the code below work right??  I get really weird errors.
Sometimes it works, sometimes it doesn't.

procedure TfrmMain.ShellCopy(sSourceDirectory, sTargetDirectory:
String);
var
  F:TshFileOpStruct;
begin
  if DirectoryExists(sSourceName) then
  begin
    F.Wnd:= Handle;
    F.wFunc:= FO_COPY;
    F.pFrom:= PChar(sSourceDirectory);
    F.pTo:= PChar(sTargetDirectory);
    F.fFlags:= FOF_NOCONFIRMMKDIR or FOF_NOCONFIRMATION;
    if ShFileOperation(F) <> 0 then
    begin
      ShowMessage('Failed');
      exit;
    end;
  end;
end;