Adding the latest event handling in the states