Moved import halt to separate function