Change queue to LIFO queue