adding console logs to trace errors