Working with queue