further cleanup to get events to trigger correctly