add concurrency limiting javascript code