added better error tracking (hopefully)