Added multithreading to the update method