added code for getting names from Ids