Fixed bug preventing wrrite