another attempt with phonegap events