close db after connecting.