Moving the database group select thing to after the database is defined