Fix syntax error
Fix race condition