Adjust queue_scripts method to better handle multiple queues.