modified addComponent, render; added prepareElement