Fixed copying last element to new element