gh-10 fixed the import in an if statement error

Related #10 

Fixed the error around wrapping an import with an if statement.