cordova device fired work around

made it more robust.