Fix server crash, moved events to a queue system, fixed name IO error