fix some regression bugs