Lily does not record accurate distance. It was okay till i got a new phone and now it is sometimes off by 2km. How do I fix this?

It was okay till i got a new phone and now it is sometimes off by 2km. How do I fix this?