bug fixes for network connection