fix jquery replacing issues