fixed empty doc case