move 'host' outside of this check