Added exceptions to get and set methods