fixed iOS loop