wrap opennign server connection in a try/catch block from refresh