trying to fix the rapid flushing