more conventional error class handling
fixed setup bugs