fix some flaws