clean up
added wait for database reset