Added more logic for hide link