moved onDeviceReady ut of app variable