Fixed exception when doc is not exists.