handle queue empty exception