Handle working dirctory for remote execution