Placed event listeners inside the onDeviceReady function