Squashing sort_ary undefined error