Queue handling with master