fix notEmpty detection bug