Fixed xhr null exception