fix badarg issue while encoding the doc id