Corrected check conditions