Added logic of multiple attributes for search