changed the catch type for exceptions from a pointer to a const reference.