fixed wrong variable used