fix shadow variable issue in init