Fixed crash tha could happen due to parallel access.