fix faulty check