bug in calculation of distance fixed
bug in calculation of distance fixed 2
[bug] cannot write db fixed