change diff end condition