fix bug for phonegap