fix behaviour bug in renameFile