improvement:flush debug messages