Added immediate setting and remote control function in main