I may be wrong, but I believe this will only work correctly if currAct is also the end of the activity queue, no?