added a cleaner solution to json access issue...using xhr? function