fix bug when skipping data