add error class, rm strange raise code