Class member variables bug solved