updated to work with latest plugman