Refactored code to search for correct identifier when importing subjects