Added filter option to getQueryFields