updating plugin to fit the new api