fix some undefined object variable checking bug