install signal handler for sigint and sigterm