fixed mentioned in comments, created permission dialog object