fixes #4, a bug preventing flush taking place.