nit: I would do the typecheck on the setter