Fix throw Error statement