tunnel logging and error fix