update fn code-dominant
fix bugs