fix bug in encoder (deleted wrong substring while sending)