decoding erlang term in the scope of the thread