fixed check_file