fixed Notice: Undefined index: extension