FIx logic