Fixing bug in queue (variable collision error)