updated plugin to accomodate types