added flag.empty?