Modified code to enable autoimport