fixed some bugs
added config from xml