Changed $this to $that in the anonymous function.