Fixed reference to "this" in directive