bug fix about wrong variable