Fixed a bug with phonegap