fixed bugs and config