Fixed error that cause to execute secuencially when assigning task to
threads