close database manually