added better erroring