fix some output notices of undefined indexes