change parent element for temporary append dependent on type of element being added
tests for if statement