Fixed ordering in the try catch block. It fails at the correct line in the try block if the accelerometer is not present