Since you now have this global flag, you probably don't need the local variable skipped anymore and could use the global flag here instead.