Updated onEnable method.