close database