change array to object