fixed print statements for signal handling