having trouble with document not existing