fixed flushing issue