made one change so that the database is only initialized when put in debug mode. This should speed things up