Rewrote plugin in groovy. Still not working...