Added newCredential func.