Updated TabDrag function.