Trying to fix writer bug