fixed error in clearing sort