Fix attributes function