adding back ability for partially restricted query generation