added gateway HTTP_REFERER check