Fix bug in inactive event check