debugged database issues