lastSeqDoc is never false because you return an object