fixed database dumping bug