changes to flush script