Correct openLinks function