Added methods for event handling