fixed a memory leak and bad assignment of event.content value