added recursion check for flushActions