Trying to flush data while is written.

Signed-off-by: Carlos Escribano Rey <carlos@markhaus.com>