fixed bug with wrong is_check calculation