adding functions to store data in db