make sure array is not empty