checking user before writing events