handle exceptions in adhoc and tunnel