Updated changes with the casting in onenable ondisable