fixed missing case end and cgset syntax