adding close() call to Scanner object