define qs before try/catch, in case we get exceprtion