fix php Notice: Undefined index error.