Fix link not getting set to nil