Better error message in case of missing document