Removed a bug in which the program crashed when all the events where deleted