Fixed error in throw with reference to a non existing variable