tried cleaning some init functions.
fix a bug.