fixed check_mode -- now working