Reversing my frame animation

I have a 23 frame animation that is moved forward or back on a mouse over. The problem is trying to reverse it. It is ok until it gets to frame 1 then it just stops. I need to get it to jump to frame 23 and to start reversing aagain.

function reverseIt(e:MouseEvent):void{
rewind = true;
this.addEventListener(Event.ENTER_FRAME,revFrame);
}

function revFrame(e:Event):void{
if(rewind == true){
tub.prevFrame();
if (currentFrame == 1){
gotoAndPlay(23);
tub.prevFrame();
}
}
}