Ok, scratch that idea.
I think your problem is here
Put a print string here to check the look at ref is getting cleared when you think it should be