make sure doc exists