added check to see if element has already been initialized as a particular class, and if so, not initialize it again.