added better errors