throwing an exception when there is a problem