add distance check