getComponent function