Added trap for SIGTERM