fix bug which caused error if search radius was too small