Fixed insert into db to be faster