forgot to define function check_result