clean database when disconnect