made scanner global in read