Add distance check