fix :write, :edit bug