fixed global attr handing bug