protected function processResponse($str)
    {

        if (!empty($this->encryption_key)) {
            $str = $this->encryptor->decrypt($str);
        }

        $this->logResponse($str);

        //check if response body is serialized json_response object and just unserialize and return if it is
        if ($this->php_serialize_response && !empty($str)) {

            try {
                $serialized = \unserialize($str);
                if ($serialized !== false) {
                    $response = $serialized;
                }
            } catch (\Exception $e) {

                if ($this->debug) {
                    echo $body;
                }
            }
        }

        //Not sure about this?
        $str = \utf8_encode($str);

        if (!isset($response)) {
            $response = new \sb\JSON\RPC2\Response($str);
        }

        return $response;
    }