close databases, some other random stuff
fixed merge conflict in db handler