use a singleton for the DB class instead of global variables