Added logic for seraching generated array for attribute name.