Updated logic for adding active link