Fixed bug - put array unregister function after line input into correct thread