writing bug fix