Fixed issue with signal handler. Still issue with certain commands