Working on db insertion