Added function for getting device from queue.