fixes some directory issues in the copy command