added stop signal handler