Use more reliable way of throwing error