added optional 'anonymous' flag to resolve()