fixed bug in re-assigning nested array