fixed a bug about flush peirod