Handle signal termination