doNext method