use flag.Duration instead of int