parse array into object