fix: the enable/disable method does not act correctly

I haven't test my code carefully in last pull request(#1255)
sorry it's my bad