final replay function