events writing fix