fix javascript for gyro motion