fixed undefined next