Changed thrown exception from just a general exception to a specific exception