Added stop button and stop logic.