handling server errors better