Work with sigint/interrupt properly

should fix #40