Fixed unefined index 0 error.