fix build and phonegap stuff