close database after data is passed to callback