added traces when throwing errors