avoid undef index warning