Changed throw 1 to throw std::exception