fix variable creep from upper scope