sorted case saving bug