refactoriing done, tested and works on cordova 3.0.0 now