fixing 'has no attribute 'host''