debug database setup and sort test suite