fixed out-of-sync bug in category tree when elements are dragged and
dropped