fix bug in plugin