A little exit handling(incomplete)