Corrected plugin to match current API