Fix self is not defined