fixed bug in rename_file and added rename_directory