changed success and error for ajax in location.js