do not use reset() to get first element because of functional side effects