added more errorhandling