fixing https://github.com/phonegap/phonegap-plugins/pull/1164#issuecomment-18876662