wrong variable passed into method