make sure scanner is not closed before findWithinHorizon