added config file and flag controller