Reworked BOB so it can access the database again