correct removing from queue logic