throw a more unique exception for invalid refs