Fixing bug with raise without exception