handling proxy mode