Queue and array raise exceptions accesing specif values that failed