Added a debug print on error