better error debugging