fix issue #32 'with-credentials throws exception'