added insert code to add data to database