Added support for hosts different than localhost