catcing socket exception on receive and send