Make sure variables are reset on link insertion