fixing the restart button functionality