fixing signal handler