Add auto dectection of value type