replace and operator with && to avoid precedence issues