Added an error tracking utility