update algorithm caused of Leap Motion API change