The perils of poorly formatted code in Stack Overflow questions. I originally missed what is probably the cause of the OP's problem because of the horizontal scrolling of the code in this question. It hides the flaw in the code.
Shared publiclyView activity