Multithreading support added