fixed test so it waits for database connection