added some db interaction