Fixed import check and made os.path without check since its a core module