resolved pickle issues caused by dynamic attributes, added some database
interaction