Fix Logic Error