rearrange function works for detail item dragged for all cases