properly handle ctrl+c