updated intent creation in switch case