some error handling on a bug I can't identify