make invalid key message more explicit about type