Added link controlling code. It works but not sure if that is necessary.