implemented registerEvent with a sent value