Trampoline solved the stack overflowing exception but DFS is not fast enough to solve some mazes. The puzzle website reported the solution took more than 10s to complete so the application was terminated. Will look into other alogrithms to solve the execution speed.