Used rewind() insteat reset() for arrays