refs #1486 fix error Using $this when not in object context