Fix slowdown issue (caused by setTimeout)