'NoneType' object has no attribute 'p_data'