make ordering works for detail tables