fix xhr problems