Add function insert into database