Fixing Undefined property: stdClass::.