Validate with type before calling setter function