Moving the db initialization because it needs to be in context