[fix] end called after writing queue is drained
[bump] version 0.3.1