adding error tracking