fixed bug when no connection to localhost