how to change the mode of controls in pre_render time