Handles restart events