improved isActive controller function