fix possible bug resulting from weird operator precedence