Fix random exiting