fixed some bugs with received XML