Erlang ETS insert/2 error
<p>I am trying to create a simple Erlang process with the access to ETS module.</p>

<p>My source code includes:</p>

<ol>
<li><p>Process creation:</p>

<pre><code>start_message_channel() -&gt;
    Table = ets:new(messages, [ordered_set, named_table]),
    Channel = spawn(?MODULE, channel, []),
    {Channel, {table, Table}}.
</code></pre></li>
<li><p>Process logic:</p>

<pre><code>channel() -&gt;
    receive
        {Sender, {send_message, {Message, Table}}} -&gt;
            ets:insert(Table, {message, Message}),
            Sender ! {self(), {status, success}};
        {Sender, {receive_message, Table}} -&gt;
            {message, Message} = ets:first(Table),
            Sender ! {self(), {status, {success, Message}}};
        _ -&gt;
            throw(incorrect_protocol_exception)
end.
</code></pre></li>
<li><p>Communication with process</p>

<pre><code>send_message_to_message_channel({Channel, {table, Table}}, Message) -&gt;
    Channel ! {self(), {send_message, {Message, Table}}},
    receive
        {Channel, {status, success}} -&gt;
            io:format("Message sent!~n");
        {Channel, {status, failure}} -&gt;
            io:format("Message failed to send!~n");
        _ -&gt;
            throw(incorrect_protocol_exception)
end.

receive_message_from_message_channel({Channel, {table, Table}}) -&gt;
    Channel ! {self(), {receive_message, Table}},
    receive
        {Channel, {status, {success, Message}}} -&gt;
            io:format(Message);
        {Channel, {status, failure}} -&gt;
            io:format("Message failed to receive!~n");
        _ -&gt;
            throw(incorrect_protocol_exception)
end.
</code></pre></li>
</ol>

<p>While executing function calls in Erlang terminal, I am getting error:</p>

<pre><code>    1&gt; cd("C:/Users/dauma").                    
    C:/Users/dauma
    ok
    2&gt; c(message_channel).
    {ok,message_channel}
    3&gt; Object = message_channel:start_message_channel().
    {&lt;0.59.0&gt;,{table,messages}}
    4&gt; message_channel:send_message_to_message_channel(Object, "Hello World!").

    =ERROR REPORT==== 19-May-2016::11:09:27 ===
    Error in process &lt;0.59.0&gt; with exit value:
    {badarg,[{ets,insert,[messages,"Hello World!"],[]},
        {message_channel,channel,0,
            [{file,"message_channel.erl"},{line,35}]}]}
</code></pre>

<p>Could anyone tell me, where might be the problem?</p>