fix usage of wrong variable