Try state instead of switch