Terminate application by event