add compatibilty for PHP 5.3 (no $this in closures allowed)