Fix for the links function