add tunnel function