Fixed crash due to multi thread access #660