Adding active_count check