Renaming file and implementing exception