updated plugin to instantiate a javascript class