Added functionality to emergency stop button.