fixed bugs in delegate_cred()