created the function of replay button.