added additional debug info for errors