Fixed Some bugs and change some behavior