fixed database global variable