Fix execption handler in server