fix Notice: Undefined variable: returnArray