added getNextItem code
must test soon