fix bugs and logs