Made Compatible with phonegap

Made Compatible with phonegap backbutton handling