prevent errors when hostname contains "protocolname" as part of it
nicer syntax
Merge pull request #9 from waquner/master

prevent errors when hostname contains "protocolname" as part of it