use setjmp and longjmp function