starting to write data into the db still fails but its a work in progress