Corrected some logic