fix leaf elements