Fixed 'Cannot use object of type stdClass as array' issue