fixed bug in point distance