ull pointer exception when calling measure;