added check for server connection