use Bash trap for cleanup