make flush non-blocking