Implement onActiveChanged event