fixed several glitch