add cast for basic types and array
update doc