fixed writing bug