minor fix in distance