FIXED scanner closing issue