added logging and exeption check for import statements