Changed the OnDeviceReady Method to hopefully fix things