added null check on scan control