Added missing pbrackets in logical expression