More functions to get queue status
Fix looping