error handling if document doesnt exists anymore