updated for new plugin api