fix bug of attributeerror self assigned