fix for  undefined index errors
move 'host' outside of this check
Merge pull request #24 from afragen/bugfix/undefined-vars

Fix `undefined index` notices.