fix js settimeout issue