fix logger reference for writing logs