added deadman and switch case structure for diffrent modes