Fixing bugs in queue record