updated php if and flush