changed eventhandlers to generic events to prevent runtime casting errors