fix
better exit handling