Did you call checkError() after flush() or instead of?