updated error and tests'