Fix JS for queuing in browser mode