Throw error if name or number is incorrect