fix bug with attributeerror