fix error in plugin mode