migrated queue mechanism to JS side