Fix wrong variable enclosing