close scanner on exception