I have a class which checks the location permission and show the dialog if not granted and its working fine if I run it separately but when I try to use it in another class