changed then$ to next