Fixed missing variable for raised exception