implemented sleep mode for mode switch
implemented sleep mode for mode switch