changing insert data code to object method: #MSG-125 in progress