added a check for a non-nil value
Merge pull request #4 from opentechinstitute/issue_159

added back end  checks for hostname != nil value, tested by @jheretic.