Added init method for initializing with ErrorClass