fixed generation of document number