corrections and removed the unused
db connection stuff.
I'll deal with that later, probably in another way.