update nearby function