fix evaluation order for logical AND and OR