output proper link while searching