implement main_stop_file feature