add checks for error or event loggging