modified insert into db