cleanup on SIGINT and SIGTERM