update function ctrlbetcode