how to set host and use host outside of view controllers