fixed crash that occurred when adding a new variety