throw in ctor if an error occurs