fixed unlock_file