Now it's working in the thread.