Fixing category link function