fix multiple thread calls in init