bad use of pointer
make exit handling work