fixed a bug in check_button