fixed database problems.