Added onFlagReturn