Added exception handling just in case server is not reachable