Left as-is, it's still not correct. Setting host needs to be based on a check for host being set, not username and password— the presence of the two are not related.