refactored import. added test for errorhandling