create id method that finds the proper attribute