Fixed the issue of getting location value