better config, fix bugs