Used an anonymous class to avoid users backward incompatibilities and side effect with users that would addAttachHandlers
Merge pull request #643 from ArcBees/cg_on_attach-2

Used an anonymous class