Added RestartThread: Fixes infinite restarting loop