fix bug of getting attributes