improving showing/hiding permission dialog