worked around reset issue in some versions of Ruby