reload function isn't working in phonegap, added some debug alerts