fix Undefined index with num var