Fix the abort error that appears when the server was stopped