Rephrase check for last event to fix bug with operator precedence. The previous expression would not evaluate to a bool.