Deleting file works properly