added enum support to readArray