update with type checking