bugfix in exception handler