Added a function to set hostname and port variables