Fix Some Logic Problem