added exception handling for import errors