separating if branch so that it can reset the credentials to empty string in case of no Credential being passed in