Fixed $writer error