Fix a crash issue in server