fix server crash because of error