Added safe global counter example