fix double database problem