finished main database operations