Fix possible racing condition
Remove unnecessary console.log