squashing sort_ary undefined error