list object has no attribute key - error msg