It might be nice to factor out this error message so it isn't pasted in two places