use replace instead of beforeSend to get rid of the caching issue