more robust state handling when processing event