modify logic

modify logic