renamed check_files method to check