fixing dump and flush script