stack should be an instance variable and not a static variable