fixed a bug that lack of self definition cause incorrect behavior