Fix isExhausted bug