Fixed setActive method