made plugin to work with multiple matched elements