Fixing potential concurence problem