Fixed wrong variable reference