added error for size 0 arrays