fix xml parsing and some memory leaks, add a few fields to queue table