changed event handlers to accept generic events to prevent casting errors