scanner should be explicitly closed