Fix Logic Problem