Added addslashes to the write code.