fix 'duplicated flip' bug