fix ctrl+c
fix file leak