fix traffic light logic