making the exception handling a little more specific