fix bug with rolling over output