Added purgeDatabase method