get sub_spaces from spaces