next() method fix