modified to use Subject.doAs