added a hardware stop switch