fixing exceptions, adding xml parser