fixed instance variable bug