added config file and some fixes