fix setTimeout issue