fix npe on document display