Added undo tree support