Fixed crash due to multi thread access