Added parenthesis around conditions