add rack and fix generate switch no break bug