added db functions to insert data into database