fix check conditions