Fixing multi boolean conditions issue