fix error 'next is undefined'
Merge pull request #3 from dunice-vadimh/develop

fix error 'next is undefined'