fix gitignore
fix open and close db