throws error if id is not a string