fixed Sgbd when close and reopen