fixed check_output