Moved the stop_file check to the end counter cleanup