Fixed phonegap event problem