remove un-needed code. see commit c57e68255e105b77c0d2e02cf19127586e81415a
handle non-existing document