Use local currentTime to avoid lag
Add setTimeout to fix strange bug