add close() for scanner class