updated check_input