Code clean-up and if the connection fails it will show the ip that has been entered instead of 'localhost'.