Fix the exit issue when training is launched.