minor bugfix for exception handling