changed array access for 'next' parsing