Updated delete_file method