Fixed nextDoc