bug in writejs