fix AttributeError: 'NoneType' object has no attribute 'get_allocation'