added return value for switch commands