Added a replay logic