added replay functionality