changed while in apply move to if