fix bugs and impl mock config