fix error for default set
moved code to makeQuery module