fix bug for flooding