modify logic