added error class, some more testing