add back in the check_file_exist function