fix most of bugs except unexplained