Added an if to prevent the code of being executed two times when importing.