handle arrays as root object correctly