fixed validation of conditions