fixed bug with haversine formula