fix bug in addCase