fix $this in closure for php 5.3