fixed little bugs, now works with stad.xml