nextDocument implemented