updated getSensor to be faster