added 502 to serverError conditional