change if to swich in main