expanded to handle scripts plugins as well