fix bug in empty doc in testing