fixed wrong use of short-curcuit AND