fixing active link logic