Fixed requestFrame bug