close databases, some other random stuff