Updated check_state() method to return bool.