minor correction on errorhandling