Added exceptions to the code