improvements in check_input