Small modification to account for returning of single-value array when setting the states from JSON