prevent app crash when document doesn't exist

correctly return 404 instead