fix isNearby method