fixed an error so method looks at instance variable