fixed next() call for 3.3 compatibility