added orderby and constraints query