corrected buffer overflow issue. Still doesnt work when sending more
than 1 msg