added replaceElement method to interface tree