debugged database integration