typecast array only when needed