Added flushing in tools