bugfix for $this reference in anon func