some refine of handling success flag