Added setActive function, implemeted it