bugfix: write failure