alters insertion function to operate only with DOM elements