Dart: fixed exception