handled the case when response contains script tags