added flag reset patch #4142