Try to put it into the exit event