updated def query

alowed sr_id to be undefined if the user is not gold.