fixed up write path