fake queue working in js