fix issue with empty doc/ns