code for inserting on database