attaching Function to OnBeforeSortEvent

I am trying to attach a function to the onBeforeSort event.  The Function Inserts some rows right brfore calling a custom two column sort function.  Adding the rows works, but then the sort doesn’t do anything.  There are no JavaScript errors reported to the browser.  Any ideas?

Please disregard, my function was not returning true, once I made it return true, everything worked fine.