solved threading problems