Add signal handler to exit