use protected db instead of global