minor improvement of exception handling. see issue #7