errorhandling has to be rethought.... g++ buggy.. clang works