Fix wrong variable used