applied patch for sorting activities