Refactor the code that prevents eventoption deletion when in use.